﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Text;
using System.Collections.Generic;
using Entity;
using BAL;
using Common;
namespace Web
{
    public partial class AdminSchool : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!UserValidate.CheckLogin(this.Request, "MasterSchool"))
            {
                Response.Write("<script type=\"text/javascript\">top.location.href='login.aspx';</script>");
                Response.Redirect("login.aspx");
                Response.End();
            }

            if (!IsPostBack)
            {
                LoadSchoolList();
                LoadAreaList();
                LoadGradeList();
                LoadClassList();
            }
        }

        protected void LoadSchoolList()
        {
            IList<SchoolInfo> schoolInfo = School.GetList();
            SchoolList.DataSource = schoolInfo;
            SchoolList.DataBind();
        }

        protected void LoadAreaList()
        {
            IList<AreaInfo> areaInfo = Area.GetList();
            AreaList.DataSource = areaInfo;
            AreaList.DataBind();
        }

        protected void LoadGradeList()
        {
            IList<GradeInfo> gradelInfo = Grade.GetList();
            GradeList.DataSource = gradelInfo;
            GradeList.DataBind();
        }


        protected void LoadClassList()
        {
            IList<TClassInfo> classlInfo = TClass.GetList();
            ClassList.DataSource = classlInfo;
            ClassList.DataBind();
        }

    }
}
